﻿CloudDisk.UploadMgr = (function(){
    var tests = {
      filereader: typeof FileReader != 'undefined',
      dnd: 'draggable' in document.createElement('span'),
      formdata: !!window.FormData,
      progress: "upload" in new XMLHttpRequest
    };
	
	var inputUploader = null;
	
	var swfUploader = null;
	
	return {
	    init: function(){
			if (tests.dnd) { 
			    CloudDisk.DdUploader.init();
			} else {
			    var btn = $('<div class="swf-uploader-btn" ><div id="swfUploaderBtn"></div></div>').appendTo($('#toolbar .toolbar-button'));
				
				CloudDisk.SwfUploader.init({
				    text: '上传文件',
					textStyle: ".theFont { font-size: 12;}",
					leftTextPadding: 12,
				    topTextPadding: 3,
					buttonId: 'swfUploaderBtn',
					buttonImage: "js/lib/uploadBtn.png",
					width: btn.width(),
					height: btn.height()
				});
			}
		},
		
		showUploader: function(){
		    if (tests.dnd) { 
			    CloudDisk.DdUploader.show();
			} else {
				//swfUploader.();
			}
		},
		
		addTask: function(){
		
		}
	};
})();